package space.jevin.jevinboot.entity;

import lombok.*;
import space.jevin.jevinboot.constant.SexEnum;
import space.jevin.jevinboot.utils.validate.EnumValue;
import space.jevin.jevinboot.utils.validate.ValidateGroup;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * 用户信息参数
 *
 * @author zhangjiehang
 * @version V1.0
 * @date 2021/5/11 12:01 下午
 */
@Data
public class BaseUserDetailParam implements Serializable {

    private static final long serialVersionUID = 2594274431751408585L;

    /**
     * 真实名称
     */
    @NotBlank(message = "realName is require", groups = {ValidateGroup.Add.class})
    private String realName;

    /**
     * 邮箱
     */
    @Email(message = "email", groups = {ValidateGroup.Add.class})
    private String email;

    /**
     * 昵称
     */
    @NotBlank(message = "nickname is require", groups = {ValidateGroup.Add.class})
    private String nickname;

    /**
     * 性别
     */
    @EnumValue(enumClass=SexEnum.class, enumMethod="isValidName",message = "sex is error", groups = {ValidateGroup.Add.class})
    private String sex;
}
